Skip to content

It allows users to get Lucky Draw Raffle tickets and use one lucky draw raffle ticket to participate in a lucky draw game.

Notifications You must be signed in to change notification settings

DreamyPhobic/Lucky-Draw-Gaming-Service

Repository files navigation

Lucky-Draw-Gaming-Service

It allows users to get Lucky Draw Raffle tickets and use one lucky draw raffle ticket to participate in a lucky draw game.

Architecture

architecture

A Backend server made with NodeJs for lucky draw gaming service.


For Testing purposes:

  • User token:

    (valid til June 26, 2024 4:38:42 AM (GMT))

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3RAZXhhbXBsZS5jb20iLCJuYW1lIjoiVGVzdCB1c2VyIiwiaWF0IjoxNjE5MjczMTIyLCJleHAiOjE3MTkzNzY3MjJ9.EX7GdBF4l8ENndXtOJqI6Vrr4VmRNChDAHZ2ZxHBPZY

  • Admin token:

    (valid til June 26, 2024 4:38:42 AM (GMT))

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3RAZXhhbXBsZS5jb20iLCJuYW1lIjoiQWRtaW4iLCJpYXQiOjE2MTkyNzMxMjIsImV4cCI6MTcxOTM3NjcyMn0.WBCLicO9YUsokHYPy8odGZGcEv0N1r9p6hcOmS61hXo

  • Testing Credentials:

Field Value
_id 608507630c011a00d1fd9297
name Sample User
email [email protected]
password test

API Requests:

Name Description
User Signup creates new user and returns the user object
User Login logs in the user and generates a token which is used to authenticate the api requests
Add Tickets [Admin only] adds the given number of tickets to the user account
Create Event [Admin only] creates new event and returns the event object
Add Participant adds a new participant in the given event
Next Events gives a list of next(on-going) events
Previous Events gives a list of previous events with winner ids and names
Compute Winner [Admin only] randomly selects a winner from participants list and saves it for a given event.

Database:

MongoDB Atlas(DaaS) is used for database. It stores all the information about users and events.

{
   _id: {type: ObjectId},
   name: { type: String, required: true },
   email: {
       type: String,
       required: true,
       unique: true,
       match: /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/
   },
   password: { type: String, required: true },
   tickets: { type: Number, default: 0 }
} 
{
    _id: {type: ObjectId},
    Reward: { type: String, required: true },
    Time: { type: String, required: true },
    Status: { type: Number, default: 0 },
    Participants: [{ type: ObjectId, ref: 'User' }],
    Winner: { type: ObjectId, ref: 'User' }

}

A mobile client app for lucky draw gaming service.

Screenshots

About

It allows users to get Lucky Draw Raffle tickets and use one lucky draw raffle ticket to participate in a lucky draw game.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published