Frontend application projection.finance.
npm install
# or
yarn install
Copy .env.example
to .env
docker-compose up
This is optional, actually we use MongoDB Atlas, the could hosted version of MongoDB.
Credentials are available on .env.example
npx prisma db push
After that, you should be able to see your db opening a graphql client with this command :
npx prisma studio
npm run dev
Open http://localhost:3000 with your browser to see the result.
Issue with Prisma on increment
operator. An Int
field need to be set before being able to increment
model Post {
id String @id @default(auto()) @map("_id") @db.ObjectId
title String
content String?
published Boolean @default(false)
viewCount Int @default(0) // this field need to be able to increment
author User? @relation(fields: [authorId], references: [id])
authorId String?
}
Here a task list that needs to be done before going to production.
- Secure Api calls with supertoken
- Clarify the use of
userId
variable, sometimes it reprensent id from Supertoken, sometimes our user ID
apres un changement :
npx prisma db push
SELECT setval(pg_get_serial_sequence('"User"', 'id'), coalesce(max(id)+1, 1), false) FROM "User";
SELECT setval(pg_get_serial_sequence('"Projection"', 'id'), coalesce(max(id)+1, 1), false) FROM "Projection";
SELECT setval(pg_get_serial_sequence('"Simulation', 'id'), coalesce(max(id)+1, 1), false) FROM "Simulation";
npx prisma generate