Apocalypse Simulator is an interactive question-and-action game where your choices affect your stats and progress. The project consists of two main parts:
- Frontend: as-react — Built with React (Vite), TailwindCSS, Zustand, and React Router.
- Backend: as-spring-boot — Powered by Spring Boot, PostgreSQL, and Google OAuth2.
Play the live demo: as.gorocode.dev
as-react
: Frontend client (React)as-spring-boot
: Backend server (Spring Boot)
- Interactive Gameplay: Make decisions, manage stats, and face enemies every 10 in-game days.
- User Authentication: Google OAuth2 login for full access and character management.
- Character Management: Create, manage, and save up to 8 characters per account.
- RESTful API: Backend exposes endpoints for game logic, user, and character management.
- Cloudinary Integration: Store and manage user profile images.
- Docker Support: Backend can be containerized for deployment.
- Frontend: React (Vite), TailwindCSS, Zustand, React Router, Google OAuth
- Backend: Spring Boot, PostgreSQL, Spring Data JPA, OAuth2, Docker, SMTP (email)
- Image Storage: Cloudinary
git clone https://github.com/gorocode/as-react.git
git clone https://github.com/gorocode/as-spring-boot.git
- Prerequisites: Node.js (>=16), npm or yarn
- Install dependencies:
cd as-react npm install
- Create a
.env
file inas-react
root:VITE_BASE_URL=<BACKEND_URL> VITE_CLOUDINARY_NAME=<YOUR_CLOUDINARY_NAME> VITE_CLOUDINARY_PRESENT=<YOUR_CLOUDINARY_PRESENT>
- Run the app:
npm run dev
-
Prerequisites: Java 21+, Maven, PostgreSQL, Google OAuth2 credentials
-
Install dependencies:
cd as-spring-boot mvn clean install
-
Create an
.env
orapplication.properties
inas-spring-boot
root:FRONTEND_URL=<YOUR_FRONTEND_URL> SPRING_DATASOURCE_URL=<YOUR_DATABASE_URL> SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GOOGLE_CLIENT_ID=<YOUR_GOOGLE_CLIENT_ID> SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GOOGLE_CLIENT_SECRET=<YOUR_GOOGLE_CLIENT_SECRET> SPRING_MAIL_USERNAME=<YOUR_EMAIL> SPRING_MAIL_PASSWORD=<YOUR_PASSWORD>
-
Run the backend:
mvn spring-boot:run
-
Docker:
Build and run the backend in Docker:docker build -t apocalypse-simulator-backend . docker run -p 8080:8080 apocalypse-simulator-backend
- Question Mode: Choose between two options to modify your stats.
- Combat Mode: Every 10 days, face an enemy with movement and shooting mechanics.
- Guest Mode: Play up to 10 in-game days without login.
- Full Access: Log in with Google to unlock all features and persistent character management.
The backend exposes RESTful endpoints for:
- Player: Create, update, list, delete, and perform actions.
- Event: Fetch random events.
- User: Manage user details, check email, login/logout.
- Contact: Submit contact forms.
See as-spring-boot/README.md
for detailed API documentation.
- Fork the repository.
- Create a feature branch.
- Commit and push your changes.
- Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE
file for more details.