Don't worry - setting up the database is easier than you think! Just follow these simple steps.
📖 Want to understand the database structure? Check out DATABASE_SCHEMA.md for detailed information about tables and relationships.
- Visit neon.tech
- Click the big "Sign up" button
- Choose "Continue with GitHub" (easiest option)
- You'll see a page asking for project details
- Just type a name like
gitnet-database - Click "Create Project"
- Wait 30 seconds... Done! 🎉
- Look for a box that says "Connection string"
- Copy the long text that starts with
postgresql:// - Save it somewhere - you'll need it in the next step!
It looks like this:
postgresql://username:password@hostname:5432/database_name?sslmode=require
cd backendcp .env.example .env.local- Open the file
.env.localin any text editor - Find the line that says
DATABASE_URL= - Replace the placeholder text with your database link from Step 1.3
- Save the file
Your file should look like this:
DATABASE_URL='postgresql://your_actual_database_link_here'Important: Keep the single quotes around your database link!
-
Navigate to the frontend folder:
cd ../frontend -
Create a frontend environment file:
echo "JWT_SECRET=your_jwt_secret_here" > .env.local
-
Important: Use the same JWT_SECRET value from your backend
.env.localfile
Note: The frontend needs the JWT_SECRET to verify authentication tokens from the backend.
Navigate back to the backend folder and run these commands one by one:
cd ../backendpnpm installDon't have pnpm? Use: npm install
npx prisma generatenpx prisma migrate deploynpx prisma studioThis should open a webpage where you can see your database tables. If it works, you're done! 🎉
💡 Want to understand what these tables do? Check out DATABASE_SCHEMA.md for detailed explanations.
pnpm startcd ../frontend
pnpm devVisit http://localhost:3000 - your app should be running!
The database has 4 main tables:
- Users: GitHub profile information
- Connections: Direct user connections
- FilteredConnections: GitHub-based connections with permissions
- Messages: Chat messages between users
For detailed schema information, see DATABASE_SCHEMA.md.
Problem: Terminal says pnpm: command not found
Solution: Use npm instead of pnpm in all commands
Problem: Can't connect to database Solution:
- Check your internet connection
- Make sure you copied the database link correctly
- Verify the database link has single quotes around it
Problem: Database tables won't create Solution:
- Double-check your database link in
.env.local - Make sure your Neon database is still active (check neon.tech)
- Try running
npx prisma db pushinstead
Problem: Frontend can't authenticate with backend Solution:
- Make sure both frontend and backend have the same
JWT_SECRETin their.env.localfiles - Check that both environment files exist and are properly configured
- Restart both frontend and backend servers after changing environment variables
- Copy the exact error message
- Create an issue on GitHub with:
- What you were trying to do
- The exact error message
- Your operating system (Windows/Mac/Linux)
- Never share your
.env.localfile - Never commit
.env.localto GitHub - If you accidentally share it, create a new database
That's it! You're ready to code! 🚀
This guide was made with ❤️ for beginners. If something confused you, let us know!