You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Go to file
unknown e3ede7484e
ajout modif du github
4 years ago
.vscode first commit 4 years ago
components ajout modif du github 4 years ago
enum first commit 4 years ago
lib first commit 4 years ago
middleware first commit 4 years ago
pages ajout modif du github 4 years ago
prisma first commit 4 years ago
public ajout modif du github 4 years ago
styles ajout modif du github 4 years ago
types first commit 4 years ago
.env first commit 4 years ago
.gitignore first commit 4 years ago
README.md first commit 4 years ago
docker-compose.yaml first commit 4 years ago
next-env.d.ts first commit 4 years ago
next.config.mjs first commit 4 years ago
package-lock.json first commit 4 years ago
package.json first commit 4 years ago
tsconfig.json first commit 4 years ago

README.md

TheTipTop - Fullstack App with Next.js


Explication rapide en français :

Une fois le repo cloné lancer les commandes suivantes :

Lancer docker avec Docker Destop

docker compose up pour créer les containers avec la base de donnée PosgreSQL et pgAdmin

npm install va installer les dépendances

npx prisma migrate dev va hydrater la db et jouer le fichier de seed (important)

npm run db (pour reset les data de la db) va reset la db et re-executer le fichier de seed

npm run dev va lancer l'application sur le localhost:3000

npx prisma studio pour naviguer dans la db via le localhost:5555 sans utiliser pgAdmin

http://localhost:3000/api/superadmin?pass=1234 pour upgrade votre compte en superadmin (vous devez être connecté)

http://localhost:3000/api/gain pour générer un gain (vous devez être connecté en tant que superadmin ou admin)


This project use TypeScript with Next.js** using React (frontend), Next.js API routes and Prisma Client (backend). It implement authentication using NextAuth.js. The app uses an PostgreSQL database file on docker's container.

Note that the app uses a mix of server-side rendering with getServerSideProps (SSR) and static site generation with getStaticProps (SSG). When possible, SSG is used to make database queries already at build-time . Sometimes, the user requesting data needs to be authenticated, so SSR is being used to render data dynamically on the server-side.

Getting started

Install npm dependencies:

npm install

2. Create and seed the database

Run the following command to create your PostgreSQL docker's container

docker compose up 
npx prisma migrate dev 

When npx prisma migrate dev is executed against a newly created database, seeding is also triggered. The seed file in prisma/seed.ts will be executed and your database will be populated with the sample data.

If you want to reset the database data run the following command

npm run db

4. Start the app

npm run dev

The app is now running, navigate to http://localhost:3000/ in your browser to explore its UI.