Skip to content

Apocalypse Simulator is an interactive question-and-action game where your choices affect your stats. Every 10 in-game days, you will face an enemy with movement and combat mechanics.

Notifications You must be signed in to change notification settings

gorocode/as-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Apocalypse Simulator

Apocalypse Simulator

📝 Overview

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


📦 Repository Structure


🚀 Features

  • 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.

🛠️ Technologies Used

  • Frontend: React (Vite), TailwindCSS, Zustand, React Router, Google OAuth
  • Backend: Spring Boot, PostgreSQL, Spring Data JPA, OAuth2, Docker, SMTP (email)
  • Image Storage: Cloudinary

📂 Installation & Setup

1. Clone the Repository

git clone https://github.com/gorocode/as-react.git
git clone https://github.com/gorocode/as-spring-boot.git

2. Frontend Setup (as-react)

  • Prerequisites: Node.js (>=16), npm or yarn
  • Install dependencies:
    cd as-react
    npm install
  • Create a .env file in as-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

3. Backend Setup (as-spring-boot)

  • Prerequisites: Java 21+, Maven, PostgreSQL, Google OAuth2 credentials

  • Install dependencies:

    cd as-spring-boot
    mvn clean install
  • Create an .env or application.properties in as-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

🎮 Game Mechanics

  • 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.

📖 API Overview

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.


🤝 Contributing

  1. Fork the repository.
  2. Create a feature branch.
  3. Commit and push your changes.
  4. Open a Pull Request.

📝 License

This project is licensed under the MIT License. See the LICENSE file for more details.


🔗 Related

About

Apocalypse Simulator is an interactive question-and-action game where your choices affect your stats. Every 10 in-game days, you will face an enemy with movement and combat mechanics.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published