This guide walks you through cloning the repository, configuring environment variables, and running both the Express/Apollo GraphQL server and the Next.js frontend locally. By the end you will have a fully working development environment with the API available atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Avendaosander/Plataforma-social/llms.txt
Use this file to discover all available pages before exploring further.
http://localhost:4005/graphql and the UI at http://localhost:3000.
Prerequisites
Before you begin, make sure the following are installed and available on your machine:- Node.js 18 or later — required by both the server (TypeScript/ESM) and the Next.js 14 frontend
- MySQL database — a running instance you can connect to with a valid connection string
- Git — to clone the repository
Setup Steps
Configure the server environment
Create a Replace
.env file inside the server directory with your MySQL connection string:USER, PASSWORD, HOST, PORT, and DATABASE with the credentials for your MySQL instance. Then generate the Prisma client and run the initial migration:npm run generate creates the type-safe Prisma client from schema.prisma, and npm run migrate applies the schema to your database (creating all tables).Start the server
Start the development server with hot-reload via nodemon:The server listens on port 4005 by default (or the value of The GraphQL endpoint is available at
process.env.PORT). You should see:http://localhost:4005/graphql.Install frontend dependencies
Open a new terminal, navigate to the
frontend directory, and install dependencies:Configure the frontend environment
Create a
.env.local file inside the frontend directory:NEXTAUTH_SECRET— a random string used to sign NextAuth session tokens (any secure random value works)NEXTAUTH_URL— the canonical URL of the Next.js app, used by NextAuth for redirectsAPI_ROUTE— the full URL of the GraphQL endpoint that Apollo Client will send requests to
The default server port is 4005, defined in
server/src/index.ts as const PORT = process.env.PORT || 4005. You can override it by setting a PORT variable in server/.env.Quick Test
Once both services are running, send the following query in the GraphQL playground or any GraphQL client to confirm the server is up and the database connection is working:[] on a fresh database). Any connection or schema error at this stage usually points to an incorrect DATABASE_URL or a skipped migration step.